<%# Template for code adding update mask query parameter to update URL.

   UpdateMask documentation is not not obvious about which fields are supported or
   how deeply nesting is supported.  For instance, if we change the field foo.bar.baz,
   it seems that *sometimes*, 'foo' is a valid value.  Other times, it needs to be
   'foo.bar', and other times 'foo.bar.baz'. If the defaults don't work for you,
   you can customize the exact list of fields that are passed for a property
   using `update_mask_fields`.
-%>
updateMask := []string{}
<%
  masks_for_props = get_property_update_masks_groups(update_body_properties)
  masks_for_props.each do |prop_name, masks| -%>

if d.HasChange("<%= prop_name %>") {
  updateMask = append(updateMask, <%= masks.map{|m| "\"#{m}\"" }.join(",\n") %>)
}
<% end # update_body_properties.each -%>
// updateMask is a URL parameter but not present in the schema, so replaceVars
// won't set it
url, err = addQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")})
if err != nil {
  return err
}
